home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-04-21 | 1.3 KB | 44 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: Utilities.cpp
- // Release Version: $ 1.0d1 $
- //
- // Author: Henri Lamiraux
- // Creation Date: 3/28/94
- //
- // Copyright: © 1993, 1994 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef UTILITIES_H
- #include "Utilities.h"
- #endif
-
- // ----- Macintosh Includes -----
-
- #ifndef __EVENTS__
- #include <Events.h>
- #endif
-
- #pragma segment drawpart
-
- //-------------------------------------------------------------------------
- // WaitForTick
- //-------------------------------------------------------------------------
-
- void WaitForTick()
- {
- long tick = ::TickCount()+1;
- while (tick >= ::TickCount()) {}
- }
-
- //-------------------------------------------------------------------------
- // MapPoint
- //-------------------------------------------------------------------------
-
- void MapPoint(FW_SPlatformPoint& pt, const FW_SPlatformRect& srcRect, const FW_SPlatformRect& dstRect)
- {
- pt.h = ((pt.h - srcRect.left) * (dstRect.right - dstRect.left)) / (srcRect.right - srcRect.left) + dstRect.left;
- pt.v = ((pt.v - srcRect.top) * (dstRect.bottom - dstRect.top)) / (srcRect.bottom - srcRect.top) + dstRect.top;
- }
-